<template>
    <ul class="directory">
        <directory-item v-for="(item, index) in list" :key="index" :item="item" :level="0" />
    </ul>
</template>

<script setup>
import DirectoryItem from './DirectoryItem.vue';
import { ref } from 'vue';

const { directory } = defineProps({
    directory: {
        type: Array,
        required: true
    }
});

const list = ref([]);

list.value = directory.map(item => ({ ...item, showChildren: false }));

</script>